/**
 * 电影，音乐，句子
 */

const { Sequelize, Model } = require('sequelize')
const { sequelize } = require('@core/db.js')

const classicField = {
  title: Sequelize.STRING,
  content: Sequelize.STRING,
  image: Sequelize.STRING,
  pubdate: Sequelize.STRING,
  fav_nums: {
    type: Sequelize.INTEGER,
    defaultValue: 0
  },
  type: Sequelize.INTEGER
}

class Movie extends Model {

}

Movie.init(classicField, {
  sequelize,
  tableName: 'movie'
})

class Music extends Model {

}

Music.init(classicField, {
  sequelize,
  tableName: 'music'
})

class Sentence extends Model {

}

Sentence.init(classicField, {
  sequelize,
  tableName: 'sentence'
})

module.exports = {
  Movie,
  Music,
  Sentence
}